package com.ruoyi.topic.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.topic.mapper.HouseVoteTopicMapper;
import com.ruoyi.topic.domain.HouseVoteTopic;
import com.ruoyi.topic.service.IHouseVoteTopicService;

/**
 * 投票题目Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-08
 */
@Service
public class HouseVoteTopicServiceImpl implements IHouseVoteTopicService 
{
    @Autowired
    private HouseVoteTopicMapper houseVoteTopicMapper;

    /**
     * 查询投票题目
     * 
     * @param topicId 投票题目主键
     * @return 投票题目
     */
    @Override
    public HouseVoteTopic selectHouseVoteTopicByTopicId(Long topicId)
    {
        return houseVoteTopicMapper.selectHouseVoteTopicByTopicId(topicId);
    }

    @Override
    public HouseVoteTopic selectHouseVoteProjectByVoteId(Long voteId)
    {
        return houseVoteTopicMapper.selectHouseVoteProjectByVoteId(voteId);
    }

    /**
     * 查询投票题目列表
     * 
     * @param houseVoteTopic 投票题目
     * @return 投票题目
     */
    @Override
    public List<HouseVoteTopic> selectHouseVoteTopicList(HouseVoteTopic houseVoteTopic)
    {
        return houseVoteTopicMapper.selectHouseVoteTopicList(houseVoteTopic);
    }

    /**
     * 新增投票题目
     * 
     * @param houseVoteTopic 投票题目
     * @return 结果
     */
    @Override
    public int insertHouseVoteTopic(HouseVoteTopic houseVoteTopic)
    {
        return houseVoteTopicMapper.insertHouseVoteTopic(houseVoteTopic);
    }

    /**
     * 修改投票题目
     * 
     * @param houseVoteTopic 投票题目
     * @return 结果
     */
    @Override
    public int updateHouseVoteTopic(HouseVoteTopic houseVoteTopic)
    {
        return houseVoteTopicMapper.updateHouseVoteTopic(houseVoteTopic);
    }

    /**
     * 批量删除投票题目
     * 
     * @param topicIds 需要删除的投票题目主键
     * @return 结果
     */
    @Override
    public int deleteHouseVoteTopicByTopicIds(Long[] topicIds)
    {
        return houseVoteTopicMapper.deleteHouseVoteTopicByTopicIds(topicIds);
    }

    /**
     * 删除投票题目信息
     * 
     * @param topicId 投票题目主键
     * @return 结果
     */
    @Override
    public int deleteHouseVoteTopicByTopicId(Long topicId)
    {
        return houseVoteTopicMapper.deleteHouseVoteTopicByTopicId(topicId);
    }
}
